package com.example.demosblogging.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2023/4/15 14:45
 */
@ResponseBody
@Controller
public class UserController {
    //获取log对象
    private final static Logger logger = LoggerFactory.getLogger(UserController.class);

    @RequestMapping("/saylog")
    public void sayLog() {
        logger.trace("这是 trace");
        logger.debug("这是 debug");
        logger.info("这是 info"); //默认
        logger.warn("这是 warn");
        logger.error("这是error");
        //fatal 系统输出，不需要用户定义
    }
}
